﻿<%@ Page Language="C#" MasterPageFile="~/Front.Master" AutoEventWireup="true" CodeBehind="AddUser.aspx.cs" Inherits="HRProject.User.AddUser" Title="Untitled Page" %>
<%@ Import Namespace="HRProject.Code.Common" %>
<asp:Content ID="IncludePlaceHolder" ContentPlaceHolderID="IncludePlaceHolder" runat="server">
    <script language="Javascript" type="text/javascript">
    function extraInit()
    {
        $("input[type=password]").keypress(function(event) {
            var tbx = $(this);
            capLock(tbx, event);
        });
    }
    
    function capLock(tbx, e){
     var td = tbx.parent();
     kc = e.keyCode?e.keyCode:e.which;
     sk = e.shiftKey?e.shiftKey:((kc == 16)?true:false);
     if(((kc >= 65 && kc <= 90) && !sk)||((kc >= 97 && kc <= 122) && sk))
      td.find('.alert-caps-lock div').css("visibility", "visible");
     else
      td.find('.alert-caps-lock div').css("visibility", "hidden");
    }
    </script>
    <style type="text/css">
        .alert-caps-lock
        {
        	width:0px;
        	height:0px;
        	float:right;
        }
        .alert-caps-lock div
        {
        	visibility:hidden;
            width:200px;
            height:50px;
            overflow:visible;
            color:#FFD4AA;
        }
    </style>
</asp:Content>
<asp:Content ID="TitleIconPlaceHolder" ContentPlaceHolderID="TitleIconPlaceHolder" runat="server">
    <img alt="" src="/image/layout/icon/UserIcon.png" />
</asp:Content>
<asp:Content ID="TitleNamePlaceHolder" ContentPlaceHolderID="TitleNamePlaceHolder" runat="server">
    <%= ContentProvider.GetString("AddUser") %>
</asp:Content>
<asp:Content ID="MainPanelPlaceHolder" ContentPlaceHolderID="MainPanelPlaceHolder" runat="server">
    <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" 
        LoginCreatedUser="False" CancelButtonText="Bỏ qua" 
        CompleteSuccessText="Tạo tài khoản thành công!" 
        ContinueButtonText="Tiếp tục" CreateUserButtonText="Tạo tài khoản" 
        DuplicateEmailErrorMessage="Email này đã tồn tại. Hãy sử dụng email khác!" 
        DuplicateUserNameErrorMessage="Hãy nhập tên tài khoản khác!" 
        FinishCompleteButtonText="Kết thúc" FinishPreviousButtonText="Trở lại" 
        InvalidAnswerErrorMessage="Hãy nhập câu trả lời khác" 
        InvalidEmailErrorMessage="Email không đúng định dạng!" 
        InvalidPasswordErrorMessage="Độ dài tối thiểu mật khẩu: {0}." 
        InvalidQuestionErrorMessage="Hãy nhập câu hỏi khác!" 
        StartNextButtonText="Bắt đầu" StepNextButtonText="Tiếp theo" 
        StepPreviousButtonText="Trở lại" 
        UnknownErrorMessage="Tạo tài khoản không thành công. Hãy thử lại" 
        ContinueDestinationPageUrl="/User/ManageUser.aspx" ActiveStepIndex="0">
        <HeaderStyle HorizontalAlign="Center" />
        <TitleTextStyle HorizontalAlign="Left" />
        <WizardSteps>
            <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
                <ContentTemplate>
                    <table border="0">
                        <tr>
                            <td align="center" colspan="2">
                                <%= ContentProvider.GetString("SignUpAccount") %></td>
                        </tr>
                        <tr>
                            <td align="left">
                                <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName"><%= ContentProvider.GetString("UserName") %>:</asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="UserName" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" 
                                    ControlToValidate="UserName" ErrorMessage="Hãy nhập tên tài khoản!" 
                                    ToolTip="User Name is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password"><%= ContentProvider.GetString("Password") %>:</asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" 
                                    ControlToValidate="Password" ErrorMessage="Hãy nhập mật khẩu!" 
                                    ToolTip="Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                <div class="alert-caps-lock"><div><%= ContentProvider.GetString("CapsLockIsOn") %></div></div>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                <asp:Label ID="ConfirmPasswordLabel" runat="server" 
                                    AssociatedControlID="ConfirmPassword"><%= ContentProvider.GetString("ConfirmPassword") %>:</asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" 
                                    ControlToValidate="ConfirmPassword" 
                                    ErrorMessage="Hãy nhập mật khẩu xác nhận!" 
                                    ToolTip="Confirm Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                <div class="alert-caps-lock"><div><%= ContentProvider.GetString("CapsLockIsOn") %></div></div>
                            </td>
                        </tr>
                        <tr>
                            <td align="left" class="style1">
                                <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email"><%= ContentProvider.GetString("Email") %>:</asp:Label>
                            </td>
                            <td class="style1">
                                <asp:TextBox ID="Email" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="EmailRequired" runat="server" 
                                    ControlToValidate="Email" ErrorMessage="Hảy nhập email!" 
                                    ToolTip="E-mail is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td align="left" colspan="2">
                                <asp:CompareValidator ID="PasswordCompare" runat="server" 
                                    ControlToCompare="Password" ControlToValidate="ConfirmPassword" 
                                    Display="Dynamic" 
                                    ErrorMessage="Mật khẩu xác nhận không trùng khớp!" 
                                    ValidationGroup="CreateUserWizard1"></asp:CompareValidator>
                            </td>
                        </tr>
                        <tr>
                            <td align="center" colspan="2" style="color:Red;">
                                <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </asp:CreateUserWizardStep>
            <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
                <ContentTemplate>
                    <table border="0">
                        <tr>
                            <td align="left" colspan="2">
                                Hoàn tất</td>
                        </tr>
                        <tr>
                            <td>
                                Tạo tài khoản thành công!</td>
                        </tr>
                        <tr>
                            <td align="right" colspan="2">
                                <asp:Button ID="ContinueButton" runat="server" CausesValidation="False" 
                                    CommandName="Continue" Text="Tiếp tục" ValidationGroup="CreateUserWizard1" />
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </asp:CompleteWizardStep>
        </WizardSteps>
    </asp:CreateUserWizard>
</asp:Content>
